package tests;

import static org.junit.Assert.*;

import org.junit.Test;

import entities.Inventory;
import fields.Territory;
import gstd.Player;

public class TestTerritory {

	@Test
	public void testGetRent() {
		Territory t = new Territory("Territory", 500, 500);		
		
		assertEquals(500, t.getRent());
	}

	@Test
	public void testLandOnField() {
		Territory t2 = new Territory("Territory", 200, 200);		
		Player p = new Player("Mr. Cat", new Inventory(200));
		Player pOwner = new Player("Mr. Dog", new Inventory(200));
		
		((Inventory)pOwner.getInventory()).addField(t2);
		t2.setOwner(pOwner);
		t2.landOnField(p);
		
		assertEquals(400, pOwner.getInventory().getBalance());
		assertEquals(0, p.getInventory().getBalance());
	}
}
